<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - SliderField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/fonts/fonts-min.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<p class='demoTitle'>inputEx - SliderField Usage</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Basic SliderField creation</p>
	
	<p>A simple SliderField instance</p>

	<div class='demoContainer' id='container1'></div>

	<div class='codeContainer'>
		<form>
		<textarea name="code" class="JScript">
			sliderField = new YAHOO.inputEx.SliderField({parentEl: 'container1'});
		</textarea>
		</form>
	</div>

</div>


<!-- Example 2 -->
<div class='exampleDiv'>

	<p class="title">Updated Event</p>
	
	<p>The updated event</p>

	<div class='demoContainer' id='container2'></div>

	<div class='codeContainer'>
		<form>
		<textarea name="code" class="JScript">
			var el = YAHOO.util.Dom.get('container2');
			var field = new YAHOO.inputEx.SliderField({parentEl: el, displayValue: false}); 
			var logDiv = inputEx.cn('div', null, null, "Log :<br />"); 
			el.appendChild(logDiv); 
			field.updatedEvt.subscribe(function(e,params) { 
					var val = params[0];
			    logDiv.innerHTML += "Updated at "+(new Date())+" with value: "+val+"<br />";
			});
		</textarea>
		</form>
	</div>

</div>



<!-- Example 3 -->
<div class='exampleDiv'>

	<p class="title">Boundaries</p>
	
	<p>WARNING: this feature does NOT work (click the button)</p>

	<div class='demoContainer' id='container3'></div>

	<div class='codeContainer'>
		<form>
		<textarea name="code" class="JScript">
			new YAHOO.inputEx.SliderField({parentEl: 'container3', minValue: 50, maxValue: 500});
		</textarea>
		</form>
	</div>

</div>


<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="../lib/yui/json/json-min.js"></script>
<script type="text/javascript" src="../lib/yui/dragdrop/dragdrop-min.js" ></script>
<script type="text/javascript" src="../lib/yui/slider/slider-min.js" ></script> 

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/Group.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/SliderField.js"  type='text/javascript'></script>

<script>
YAHOO.util.Event.addListener(window, 'load', function() {

	// Example 1
	var sliderField = new YAHOO.inputEx.SliderField({parentEl: 'container1'});
	
	
	// Example 2
	var el = YAHOO.util.Dom.get('container2');
	var field = new YAHOO.inputEx.SliderField({parentEl: el, displayValue: false}); 
	var logDiv = inputEx.cn('div', null, null, "Log :<br />"); 
	el.appendChild(logDiv); 
	field.updatedEvt.subscribe(function(e,params) { 
			var val = params[0];
	    logDiv.innerHTML += "Updated at "+(new Date())+" with value: "+val+"<br />";
	});
	
	
	// Example 3
	var field3 = new YAHOO.inputEx.SliderField({parentEl: 'container3', minValue: 50, maxValue: 500});
	var button = inputEx.cn('button',null,null,"set value to 345");
	YAHOO.util.Event.addListener(button,"click",function() {
		field3.setValue(345);
	});
	YAHOO.util.Dom.get('container3').appendChild(button);
	
});

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>